package org.budo.activiti.form.type;

import org.activiti.engine.form.AbstractFormType;
import org.apache.commons.lang3.StringUtils;

/**
 * 日期范围
 * 
 * @author lmw
 */
public class DateRangeFormType extends AbstractFormType {
    private static final long serialVersionUID = 6211563764919119612L;

    public static final String NAME = "date_range";

    @Override
    public String getName() {
        return NAME;
    }

    @Override
    public Object convertFormValueToModelValue(String propertyValue) {
        if (StringUtils.isEmpty(propertyValue)) {
            return null;
        }

        // ["2020-02-05T16:00:00.000Z","2020-03-09T16:00:00.000Z"]
        return propertyValue;
    }

    @Override
    public String convertModelValueToFormValue(Object modelValue) {
        throw new RuntimeException();
    }
}